package com.xxx.greneric;

import com.xxx.Map.Student;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/21  14:00
 * @Copyright
 */
public class GenericDome04 {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("李四",22));
        //it(students);

        ArrayList<Worker> workers = new ArrayList<>();
        workers.add(new Worker("李四",22));
        //it(workers);

        ArrayList<String> Strings = new ArrayList<>();
        Strings.add("a");
        //it(Strings);
    }

    private static  void  it(ArrayList<? super Prseon > arrayList){
        Iterator<?> iterator = arrayList.iterator();
        while (iterator.hasNext()){
            Object next = iterator.next();
        }
    }
}
